#include "timpwmledinit.h"
#include "plusechange.h"
#include "config.h"
#include "debug.h"

int main(void)
{
    NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
    Delay_Init();
    USART_Printf_Init(115200);
    printf("SystemClk:%d\r\n", SystemCoreClock);

    TimPwmLedInit(TIM1_Period, TIM1_Prescaler);

    uint8_t pwmCctlValue = 0;
    uint8_t toggleFlag = 0;

    while(1)
    {
        PluseChange(&pwmCctlValue, &toggleFlag);

        TIM_SetCompare1(TIM1, pwmCctlValue);
    }
}
